class Student:
    name= None
    gender=None
    age=None
    __is_5g_enable=False
    #self是关键字，表示类对象自身的意思,在方法内，想访问成员变量的话必须使用self
    def str(self):
          print(f"大家好我是{self.name},我今年{self.age}岁,我的性别是{self.gender}")
        #可以忽略掉self
    def arg(self,msg):
        print(f"大家好，我是{msg}")

    def __init__(self,name,gender,age):
        self.name=name
        self.gender=gender
        self.age=age
        print("Student类创建了一个对象,init方法每次创建对象就会被调用")
    #lt用来比大小
    def __lt__(self,other):
        return  self.age<other.age
    #le哟过来比较>=和<=
    def __le__(self, other):
        return self.age<=other.age
    #比较类对象
    def __eq__(self, other):
        return self.age==other.age
    def __check_5g(self):
        if self.__is_5g_enable==True:
            print("5g打开")
        else:
            print("5g关闭，启动4g网络")
    def call_by_5g(self):
        self.__check_5g()
        print("正在通话中")
#创建一个对象 创建多个对象
stu1=Student("xsk","男",20)
stu2=Student("wyg","人",20)
stu1.str()
print(stu1>stu2)
print(stu1<=stu2)
print(stu1==stu2)
stu1.call_by_5g()
#对对象进行赋
#stu3=Student("徐赛坤","男","20")
#stu3.__init__(1,3,3)
#stu3.str()


class Teacher(Student):
    id=0
tea1=Teacher("sss","dsadsa",666)
print(tea1.name)

class People(Teacher,Student):  #左边优先重复的时候
    pass

from typing import Union, Generator

a: int =10
b:Union[int,str]=0



#多态
class kongtiao:
    def coll(self):
        pass
    def hot(self):
        pass
    def swing(self):
        pass

class meidi(kongtiao):
    def coll(self):
        print("美的空调制冷")
    def hot(self):
        print("美的空调制热")
    def swing(self):
        print("美的空调左右摆风")

class geli(kongtiao):
    def coll(self):
        print("格力空调制冷")
    def hot(self):
        print("格力空调制热")
    def swing(self):
        print("格力空调左右摆风")
def aaa(r :kongtiao):
     r.coll()

M=meidi()
D=geli()
aaa(M)
aaa(D)